<template>
	<view>
		<view class="cu-list menu sm-border card-menu margin-top">
			<view class="cu-item ">
				<view class="content">
					<text class="cuIcon-profile text-grey"></text>
					<text class="text-grey">登录账号</text>
				</view>
				<view class="action">
					<text class="text-gray">{{userid}}</text>
				</view>
			</view>

			<view class="cu-item ">
				<view class="content">
					<text class="cuIcon-people text-grey"></text>
					<text class="text-grey">用户名</text>
				</view>
				<view class="action">
					<text class="text-gray">{{name}}</text>
				</view>
			</view>

			<view class="cu-item ">
				<view class="content">
					<text class="cuIcon-group text-grey"></text>
					<text class="text-grey">角色</text>
				</view>
				<view class="action">
					<view  class="text-gray">{{role_names}}</view>
				</view>
			</view>

			<view class="cu-item ">
				<view class="content">
					<text class="cuIcon-mail text-grey"></text>
					<text class="text-grey">邮箱</text>
				</view>
				<view class="action">
					<text class="text-gray">{{email}}</text>
				</view>
			</view>

			

			<view class="cu-item ">
				<view class="content">
					<text class="cuIcon-phone text-grey"></text>
					<text class="text-grey">手机</text>
				</view>
				<view class="action">
					<text class="text-gray">{{phone}}</text>
				</view>
			</view>

		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userid: '',
				name: '',
				role_names: [],
				is_admin: 0,
				email: '',
				phone: '',
				email_notice: 0,
				phone_notice: 0,
				inner_notice: 0,
				
				userinfo:'',
			}
		},
		onLoad(options){
			try {
				this.userinfo = uni.getStorageSync('userinfo');
				if (this.userinfo) {
					var obj = JSON.parse(this.userinfo)
					console.info(this.userinfo)
					this.userid = obj.userid
					this.name = obj.name
					this.is_admin = obj.is_admin
					this.email = obj.email
					this.phone = obj.phone
					this.role_names = obj.role_names
				}
			} catch (e) {
				// error
			}
		},
		onShow() {
			uni.setNavigationBarTitle({
				title: "个人信息"
			})
		},
		methods: {

		}
	}
</script>

<style>
	.cu-item {
		background-color: transparent !important;
	}
</style>